<template>
	<view class="cardstyle">
		<slot name="header"></slot>
		<text class="titlebox">{{title}}</text>
		<view class="tipsbox">
			<text style="color: #f00;" v-if="isTop">置顶</text>
			<text>{{author}}</text>
			<text>{{comments}}评</text>
			<view style="flex: 1; display: flex; justify-content: flex-end;">
				<text>{{time}}</text>
			</view>
		</view>
		<slot name="tips"></slot>
		<slot name="footer"></slot>
	</view>
</template>

<script>
	export default {
		name:"cardViewText",
		data() {
			return {
				
			}
		},
		props:{
			title:{
				type:String,
				default:"新闻标题",
				require:true
			},
			isTop:{
				type:Boolean,
				default:false,
				require:true
			},
			author:{
				type:String,
				default:"来源",
				require:true
			},
			comments:{
				type:Number,
				default:0,
				require:true
			},
			time:{
				type:String,
				default:"2025.10.28"
			}
		},
		methods: {
			
		}
	}
</script>

<style scoped>
	.cardstyle{
		background-color: aliceblue;
		padding: 10rpx;
		border-bottom: 1rpx solid #eee;
		border-radius: 5%;
	}
	.titlebox{
		font-size: 14px;
		font-weight: bold;
		margin-bottom: 5rpx;
	}
	.tipsbox{
		display: flex;
		gap: 10rpx;
		font-size: 12px;
		color: #666;
		margin-bottom: 5px;
	}
</style>
